package com.cw.auth.common.enums;

import lombok.Getter;

/**
 * @author: 江传文
 * @date: 2024/4/7 20:08
 * 删除状态枚举
 */
@Getter
public enum IsDeletedFlagEnum {
    DELETED(1, "已删除"),
    UN_DELETED(0, "未删除");

    public final int code;
    public final String desc;

    IsDeletedFlagEnum(int code, String desc) {
        this.code = code;
        this.desc = desc;
    }

    public static IsDeletedFlagEnum getByCode(int codeVal){
        for(IsDeletedFlagEnum isDeletedFlagEnum : IsDeletedFlagEnum.values()){
            if(isDeletedFlagEnum.code == codeVal){
                return isDeletedFlagEnum;
            }
        }
        return null;
    }

}
